package com.cenxi.controller;

import com.cenxi.pojo.PostPo;
import com.cenxi.service.AsyncService;
import com.cenxi.service.SendService;
import com.cenxi.util.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author cenxi
 * @Date 2023/8/30 11:35
 * @Version 1.0
 */
@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {

    @GetMapping("/list")
    public Object list() {
        log.info("jenins部署springboot项目成功1");
        return "<h1>jenins部署springboot项目成功1</h1>";
    }

    @Autowired
    private AsyncService asyncService;
    @GetMapping("/lock")
    public Object unlock() {
        return asyncService.async();
    }


    @GetMapping("/get/{getName}")
    public Object getName(@PathVariable("getName") String getName) {
        log.info("控制层获取数据-get: {}", getName);
        return HttpUtil.getIpAddress(getName);
    }


//    @PostMapping("/post")
//    public Object post(@RequestBody PostPo postPo) {
//        log.info("控制层获取数据-post: {}", postPo);
//        return postPo;
//    }
}
